//
//  THPCenterViewController.m
//  TaiHao
//
//  Created by rzm on 16/5/31.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SampuxPCenterViewController.h"
#import "SampuxPCenterView.h"
#import "SampuxReminderViewController.h"


@interface SampuxPCenterViewController()

@property (nonatomic, strong) SampuxPCenterView *pCenterView;

@end

@implementation SampuxPCenterViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.navigationItem setHidesBackButton:YES];

    _pCenterView = [[SampuxPCenterView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];
    self.pCenterView.phoneNumView.textFiled.text = self.teleStr;
    [self.view addSubview:_pCenterView];
    __weak typeof(SampuxPCenterViewController *) wSelf = self;
    
    _pCenterView.popBlock = ^{
        dispatch_async(dispatch_get_main_queue(), ^{
            [wSelf.navigationController popToRootViewControllerAnimated:YES];
        });
    };
    
    _pCenterView.forgetPWBlock = ^{
        dispatch_async(dispatch_get_main_queue(), ^{
            SampuxReminderViewController *reminderVC = [[SampuxReminderViewController alloc]init];
            [wSelf.navigationController pushViewController:reminderVC animated:YES];
            
        });
    };
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    SampuxCustomNavController *nav = (SampuxCustomNavController *)self.navigationController;
    nav.titleStr = @"个人中心";
}



@end
